
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-script-type" content="text/javascript" />
<meta http-equiv="content-style-type" content="text/css" />

<title>DynamicForm</title>
<meta name="description" content="Dynamic Form" />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>

<script type="text/javascript"
	src="assets/jquery/jquery.corner.js?v2.01"></script>
<script type="text/javascript" src="assets/jquery/jquery.contextmenu.js"></script>

<script type="text/javascript" src="assets/framework/js/variables.js"></script>
<script type="text/javascript" src="assets/SwiftUIClient/js/SwiftUI.js"></script>
<script type="text/javascript"
	src="assets/SwiftUIClient/js/SwiftUI2jQuery.js"></script>
<script type="text/javascript"
	src="assets/SwiftUIClient/js/i18n/SwiftUILocale_en.js"></script>
<link rel="stylesheet" type="text/css"
	href="assets/SwiftUIClient/css/swiftui.designer.css" media="all" />
<link rel="stylesheet" type="text/css" media="screen" href="assets/jquery/themeroller/themes/base/jquery-ui.css" />

<link rel="stylesheet" type="text/css"
	href="assets/swiftuidesigner/stylesheets/jquery.contextmenu.css"
	media="all" />



<script>
	SwiftUI.loadModule('UIDesigner','UIperspective');
	//SwiftUI.loadModule('UIperspective');
	
	
	SwiftUI.onLoad(function() {
		// Create perspective
		var perspective = new SwiftUI.UIPerspective({});
		SwiftUI.setPerspective(perspective);
		perspective.loadCenterTabs();
		
		SwiftUI.getPerspective().loadOrSelectTab("center",1,"events.xml")
		
		
		var newtextBox = new SwiftUI.TextBoxComponent("test");
		var textBox = SwiftUIComponentFactory.getComponent(SwiftUI.UIDesignComponent.ComponentTypes.TextBox);
		SwiftUI.enableLogging();
		SwiftUI.log(textBox.component.getColSpan());
		SwiftUI.log(SwiftUI.viewport().width+"     "+SwiftUI.viewport().height);
		SwiftUI.log(SwiftUI._j("swiftui_designer_whiteboard").width()+"     "+SwiftUI._j("swiftui_designer_whiteboard").height());
		//SwiftUI._j("swiftui_designer_whiteboard").css({'width':SwiftUI.viewport().width-100 ,'height':SwiftUI.viewport().height-80 });
		
		alert(SwiftUI.viewportOffset("swiftui_designer_whiteboard").left+"     "+SwiftUI.viewportOffset("swiftui_designer_whiteboard").top);

		$(".swiftui_designer_draggable").draggable({
			revert : true,
			helper : 'clone',
			start : function(event, ui) {
				$(this).fadeTo('fast', 0.5);
			},
			stop : function(event, ui) {
				$(this).fadeTo(0, 1);
			}
		});

		$(".swiftui_designer_droppable").droppable({
			hoverClass : 'active',
			drop : function(event, ui) {
				this.value = $(ui.draggable).text();
			}
		});
		
		$("#swiftui_primitive_textbox_1").hover(
				  function () {
					  if(!($(this).parent().hasClass("swiftui_designer_draggable")))
						  $(this).wrap('<div class="swiftui_designer_draggable" />');
				  },
				  function () {
					  $(this).unwrap();
				  }
		);
	
	});

</script>
</head>
<body>
	<div class="swiftui_designer_body">
		<div id="swiftui_designer_componentview">
			<div class="swiftui_designer_draggable">Hello!</div>
			<div class="swiftui_designer_draggable">Drag this box</div>
			<div class="swiftui_designer_draggable">to the textbox</div>
			<div class="swiftui_designer_draggable">and see the magic	happen</div>
				
			<input id="swiftui_primitive_textbox_1" class="hoverTest" type="text" value= "test"> </input>	
		</div>
		<div id="swiftui_designer_whiteboard">
			<div id="droppableHolder" class="swiftui_designer_droppableHolder">
				Drop in this text box:<br /> <br /> 
				<input type="text"
					id="droppable" class="swiftui_designer_droppable" />
					<br></br>
					
			</div>
		</div>
		<div id="swiftui_center_window_tabs">   <ul>
	    </ul></div>
		
	</div>
</body>
</html>